package org.example.trans.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.trans.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.beans.Transient;

@Slf4j
@RestController
@RequestMapping("/trans")
public class TransController {
    @Autowired
    private LogService logService;

    @Transactional
    @RequestMapping("/registry")
    public Boolean registry(String name,String op){
        Integer result = logService.insertLog(name, op);
//        log.info("影响的行数："+result);
        return true;
    }

}
